package it.univaq.mwt.common.business;

import it.univaq.mwt.business.GiftService;

public abstract class GiftServiceFactory {

	private static GiftServiceFactory instance;
	
	public abstract GiftService getGiftService();
	

	protected GiftServiceFactory() {
	}
	
	public synchronized static GiftServiceFactory getInstance() {
		if (instance==null) {
			throw new RuntimeException();
		}
		return instance;
	}
	

	public synchronized static void setInstance(GiftServiceFactory factory) {
		if (instance!=null) {
			throw new RuntimeException();
		}
		instance = factory;
		
	}
}
